﻿@using IdentityServer4.Extensions
@using Jp.UI.SSO.Controllers.Home
@using Microsoft.AspNetCore.Hosting
@model Jp.UI.SSO.Controllers.Home.ErrorViewModel
@{
    if (Context.User.IsAuthenticated())
    {
        Layout = "~/Views/Shared/_Layout.cshtml";
    }
    else
    {
        Layout = "~/Views/Shared/_LayoutExt.cshtml";

    }
}
@if (Context.User.IsAuthenticated())
{
    @section breadcrumb
        {

        <!-- Breadcrumb-->
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a asp-action="Index" asp-controller="Home">User</a>
            </li>
            <li class="breadcrumb-item">
                Error
            </li>
        </ol>
    }
}

<div class="container-fluid">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card p-8">
                <div class="card-body">
                    <div class="alert alert-danger">
                        Sorry, there was an error

                        @if (Model?.ErrorMessage != null)
                        {
                            <strong>
                                <em>
                                    : @Model?.ErrorMessage
                                </em>
                            </strong>

                            if (Model?.ErrorDescription != null)
                            {
                                <div>@Model?.ErrorDescription</div>
                            }
                        }
                    </div>

                    @if (Model?.RequestId != null)
                    {
                        <div class="request-id">Request Id: @Model?.RequestId</div>
                    }

                    <p>
                        Click <a asp-controller="Account" asp-action="Login">here</a> to go back.
                    </p>
                </div>
            </div>
        </div>
    </div>
</div>
